<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:hmrDetail="http://java.sun.com/jsf/composite/detail"
	xmlns:hmrSearch="http://java.sun.com/jsf/composite/search"
	xmlns:hmrList="http://java.sun.com/jsf/composite/list">


	<p:confirmDialog id="deleteModalityDialog" message="#{msgs.DoYouReallyWantToDeleteThisEntry}"	header="#{msgs.Warning}" severity="alert" widgetVar="wconfExcMod">
 		<h:form prependId="false">
			<p:commandButton value="#{msgs.AllVersions}" oncomplete="wconfExcMod.hide();"	process="@form" actionListener="#{modalityBean.deleteVersionableModality}"
				update=":listModalityForm:modalitysTable, :growl, :content"  />

			<p:commandButton value="#{msgs.OnlyTheVersion} #{modalityBean.versionableModality.modality.version}" oncomplete="wconfExcMod.hide();"	process="@form" actionListener="#{modalityBean.deleteModality}"
				update=":listModalityForm:modalitysTable, :growl, :content"  />

			<p:commandButton value="#{msgs.Cancel}" onclick="wconfExcMod.hide();"	type="button" />
		</h:form>
	</p:confirmDialog>

	<p:dialog id="findModality" header="#{msgs.FindModality}"  widgetVar="wfindModality" modal="true" >
		<hmrSearch:modalitySearch handler="#{modalityBean.modalitySearch}" 	onSearchComplete="PF('wfindModality').hide();"
			searchUpdate=":listModalityForm:modalitysTable, :growl"		showResultsPanel="false"/>
	</p:dialog>

	<p:dialog id="crossReferenceDialog" header="#{msgs.CrossReferences}"  appendTo="@(body)" widgetVar="wcrossReferenceDialog" modal="true" >
		<p:dataTable value="#{modalityBean.references}" var="reference" style="width:500px">
			<p:column headerText="Tipo">
				<h:outputText value="#{msgs[reference.used.nameKey]}" />
			</p:column>
			<p:column headerText="Nome">
				<h:outputText value="#{reference.used.name}" />
			</p:column>
			<p:column headerText="Versão">
				<h:outputText value="#{reference.used.version}" />
			</p:column>
			<p:column headerText="Utilizado por">
				<h:outputText value="#{msgs[reference.usedBy.nameKey]}" />
			</p:column>
			<p:column headerText="Nome">
				<h:outputText value="#{reference.usedBy.name}" />
			</p:column>
			<p:column headerText="Versão">
				<h:outputText value="#{reference.usedBy.version}" />
			</p:column>

		</p:dataTable>
	
	</p:dialog>


	
</html>	